package com.dyz.model;


import java.util.Scanner;

public class AFaktura {

	private String number, companyName, adress, descr;
	private float kwotaVat;
	protected int vat;
	private static int licznik=1;
	private int numerFaktury;
	private String date;
	public int d,m,y;

	


	public AFaktura(String number, String date, String companyName,
			String adress, String descr, int vat) {
		super();
		
		Scanner s = new Scanner(date);
		s.useDelimiter("-");
		
//		y = new Integer(data.substring(6, 10));
//		m = new Integer(data.substring(3, 5));
//		d = new Integer(data.substring(0, 2));
		
		d = s.nextInt();
		m = s.nextInt();
		y = s.nextInt();
		s.close();

		// System.out.println(y+""+m+""+d);
		this.date = date;
		this.number = number;
		this.adress = adress;
		this.descr = descr;
		this.companyName = companyName;
		this.vat = vat;
		numerFaktury = ++licznik;
		
	}
	

	public String toString() {
		return String.format("%d.  %s  %s  %s  %s  %s  ", numerFaktury,
				date , number, companyName, adress, descr);
	}

	public String toFormatString() {

		return String.format("%6s. |%s| |%-20s| |%-20s| |%-50s| |%-20s| ",
				numerFaktury, date, number+".", companyName, adress, descr);

	}

	public String getCompanyName() {
		return companyName;
	}

	public float getVat() {
		return vat;
	}

	public float getKwotaVat() {
		return kwotaVat;
	}

	
	public static void zerujFaktury(){
		licznik = 1;
	}
	
	public int getMonth(){
		return m;
	}
	
	public void changeNumTo(int i){
		numerFaktury = i;
	}
	
	public int getNumerFaktury(){
		return this.numerFaktury;
	}
	public boolean isPrzychod(){
		return false;
	}
	
	public float getCenaNetto(){
		return 0;
	}
	
	public float getCenaDod(){
		return 0;
	}
	


}
